<?php

include 'base.php';

if($is_login == 0){
	echo "<script>";
	echo "alert('Please login or ontact us for new account.');";
	echo "location.href='index.php'";
	echo "</script>";
	die();
}


$sql2 = "select *  from downloads   order by place,id  desc  ";
	
			$db->query($sql2);

while ($row = $db->fetch_array()) {

$url = "downloads/".$row['url'];

if (file_exists($url)) {

	$file_size = filesize($url) ;

	$row['size'] = byte_format($file_size);
	$row['ext'] = extend_1($url);
	$row['last_modified'] =  strftime('%Y-%m-%d', filemtime($url));
	$row['url'] = $url;
}
//pre($row);

			$docs[] = $row;



		}

			$tpl->assign ( 'docs', $docs );



$tpl->show("catalog");

?>